package cn.cream4u.ksks.abService;

import cn.cream4u.ksks.acMapper.StuMapper;
import cn.cream4u.ksks.adPojo.StuPojo;
import cn.cream4u.ksks.adPojo.StuPojo2;
import cn.cream4u.ksks.adPojo.StuPojo3;
import cn.cream4u.ksks.adPojo.StuPojo4;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StuImpl implements StuServ{
    @Autowired
    StuMapper stuMapper;
    @Override
    public StuPojo2 selectPojos(Integer page, Integer pagesize, String name, Integer educationId, Integer number, Integer classId) {
        page = (page-1)*pagesize;
        List<StuPojo> kk = stuMapper.selectPojos(page, pagesize, name, educationId, number, classId);
        int total = stuMapper.selectPojosCount(page, pagesize, name, educationId, number, classId);
        return new StuPojo2(total,kk);
    }

    @Override
    public StuPojo selectPojoById(Integer id) {
        return stuMapper.selectPojoById(id);
    }

    @Override
    public void updatePojo(StuPojo3 pojo) {
        stuMapper.updatePojo(pojo);
    }

    @Override
    public void insertStu(StuPojo4 pojo) {
        stuMapper.insertStu(pojo);
    }

    @Override
    public void deleByIds(Integer[] kks) {
        stuMapper.deleById(kks);
    }

    @Override
    public void disdis(Integer id, Integer disciplineScore) {
        stuMapper.disdis(id,disciplineScore);
    }

}
